package cn.edu.scau.dropship.ServiceImpl;

import cn.edu.scau.dropship.entity.Menu;
import cn.edu.scau.dropship.entity.MenuExample;
import cn.edu.scau.dropship.mapper.MenuMapper;
import cn.edu.scau.dropship.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MenuServiceImpl implements MenuService {
    @Autowired
    private MenuMapper menuMapper;

    @Override
    public long countByExample(MenuExample example) {
        return menuMapper.countByExample(example);
    }

    @Override
    public int deleteByExample(MenuExample example) {
        return menuMapper.deleteByExample(example);
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return menuMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Menu record) {
        return menuMapper.insert(record);
    }

    @Override
    public int insertSelective(Menu record) {
        return menuMapper.insertSelective(record);
    }

    @Override
    public List<Menu> selectByExample(MenuExample example) {
        return menuMapper.selectByExample(example);
    }

    @Override
    public Menu selectByPrimaryKey(Integer id) {
        return menuMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByExampleSelective(Menu record, MenuExample example) {
        return menuMapper.updateByExampleSelective(record, example);
    }

    @Override
    public int updateByExample(Menu record, MenuExample example) {
        return menuMapper.updateByExample(record, example);
    }

    @Override
    public int updateByPrimaryKeySelective(Menu record) {
        return menuMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Menu record) {
        return menuMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Menu> getList() {
        MenuExample menuExample=new MenuExample();
        MenuExample.Criteria criteria=menuExample.createCriteria();
        criteria.andIdIsNotNull();
        List<Menu> list=menuMapper.selectByExample(menuExample);
        return list;
    }
}
